<template>
  <div class="dashboard-container">
    <div class="dashboard-top">
      <el-card class="card">
        <div class="top">
          <span>总答题数量</span>
          <el-tooltip
            class="item"
            effect="dark"
            content="指标说明"
            placement="top"
          >
            <i class="el-icon-warning" />
          </el-tooltip>
        </div>
        <div class="center">260,560</div>
        <div class="bottom_one">
          周同比 12%<i class="el-icon-caret-top" style="color: red" />日环比
          11%<i class="el-icon-caret-bottom" style="color: green" />
        </div>
        <div class="bottom_two">日答题数量 12,423</div>
      </el-card>
      <el-card class="card">
        <div class="top">
          <span>试题方向</span>
          <el-tooltip
            class="item"
            effect="dark"
            content="指标说明"
            placement="top"
          >
            <i class="el-icon-warning" />
          </el-tooltip>
        </div>
        <div class="center2">
          <one />
        </div>
        <div class="bottom_two">试题库数量 10,234</div>
      </el-card>
      <el-card class="card">
        <div class="top">
          <span>试题学科分布</span>
          <el-tooltip
            class="item"
            effect="dark"
            content="指标说明"
            placement="top"
          >
            <i class="el-icon-warning" />
          </el-tooltip>
        </div>
        <div class="center2">
          <two />
        </div>
        <div class="bottom_two">前端试题数量 5,234</div>
      </el-card>
      <el-card class="card">
        <div class="top">
          <span>上周试题新增</span>
          <el-tooltip
            class="item"
            effect="dark"
            content="指标说明"
            placement="top"
          >
            <i class="el-icon-warning" />
          </el-tooltip>
        </div>
        <div class="center3">
          <three />
        </div>
        <div class="bottom_two">上周新增总量 1,234</div>
      </el-card>
    </div>
    <el-card>
      <div class="main">
        <div class="four">
          <four />
        </div>
        <div class="right">
          <div class="topTitle">前端与java学科试题走势图</div>
          <div class="bottom">
            <div class="title">学科试题数量排名</div>
            <list />
          </div>
        </div>
      </div>
    </el-card>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import one from './components/one.vue'
import two from './components/two.vue'
import three from './components/three.vue'
import four from './components/four.vue'
import list from './components/list.vue'
export default {
  name: 'Dashboard',
  components: {
    one,
    two,
    three,
    four,
    list
  },
  data() {
    return {}
  },
  computed: {
    ...mapGetters(['name'])
  }
}
</script>

<style lang="scss" scoped>
.dashboard {
  &-container {
    margin: 30px;
  }
  &-top {
    display: flex;
  }
}
.card {
  flex: 1;
  /*   height: 240px; */
  margin: 0 5px;
}
.top {
  display: flex;
  justify-content: space-between;
  color: #97a8be;
  font-size: 14px;
}
.center {
  font-size: 30px;
  height: 140px;
  line-height: 140px;
  padding-left: 20px;
  margin-bottom: 40px;
}
.bottom_one {
  font-size: 14px;
  margin-bottom: 5px;
}
.bottom_two {
  font-size: 14px;
  border-top: 1px solid #d5d8dd;
  padding-top: 10px;
}
.center2 {
  width: 100%;
  height: 200px;
  transform: scale(0.9);
}
.center3 {
  width: 100%;
  height: 200px;
  transform: scale(0.9);
  margin-top: 20px;
}
.main {
  display: flex;
  justify-content: space-between;
  height: 400px;
  .four {
    width: 600px;
    height: 350px;
  }
  .right {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    width: 400px;
    height: 350px;
    .topTitle {
      text-align: right;
      font-size: 20px;
      color: #d5d8dd;
    }
    .bottom {
      width: 400px;
      .title {
        color: black;
        text-align: left;
      }
    }
  }
}
</style>
